package com.alibaba.citrus.cr.mn.order.center.facade.function.convert;

import com.epoch.app.crforecastsales.model.dto.ConfirmForecastDTO;
import com.epoch.app.crforecastsales.model.dto.ForecastOrderLineBizDO;
import com.epoch.app.mnordercenter.model.dto.AnalysisForecastBizDTO;
import com.epoch.app.mnordercenter.model.dto.ConfirmReplyResponseDTO;
import org.springframework.beans.BeanUtils;

import java.util.List;
import java.util.stream.Collectors;

public class ConfirmDTOInnerToOuterConvert {

    public static ConfirmReplyResponseDTO convert(ConfirmForecastDTO confirmForecastDTO) {
        ConfirmReplyResponseDTO confirmReplyResponseDTO = new ConfirmReplyResponseDTO();
        confirmReplyResponseDTO.setSalesOrderNo(confirmForecastDTO.getForecastOrderBizNO());
        confirmReplyResponseDTO.setLineNo(confirmForecastDTO.getLineNo());
        confirmReplyResponseDTO.setSuccess(confirmForecastDTO.getSuccess());
        confirmReplyResponseDTO.setErrorCode(confirmForecastDTO.getErrorCode());
        confirmReplyResponseDTO.setMessage(confirmForecastDTO.getMessage());
        return confirmReplyResponseDTO;
    }

    public static ConfirmReplyResponseDTO buildErrorResponse(String errorCode,String errorMessage,Boolean success,String taskId) {
        ConfirmReplyResponseDTO confirmReplyResponseDTO = new ConfirmReplyResponseDTO();
        confirmReplyResponseDTO.setErrorCode(errorCode);
        confirmReplyResponseDTO.setMessage(errorMessage);
        confirmReplyResponseDTO.setSuccess(success);
        confirmReplyResponseDTO.setBatchTaskId(taskId);
        return confirmReplyResponseDTO;
    }
}
